﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Groups.aspx.cs" Inherits="Mercator2.UI.Groups" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
    Cadastro de Grupos</p>
<p>
    <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
        AutoGenerateRows="False" BackColor="White" BorderColor="#E7E7FF" 
        BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="GroupID" 
        DataSourceID="SqlDataSource1" GridLines="Horizontal" Height="50px" 
        Width="252px">
        <AlternatingRowStyle BackColor="#F7F7F7" />
        <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
        <Fields>
            <asp:BoundField DataField="GroupID" HeaderText="Código" ReadOnly="True" 
                SortExpression="GroupID" />
            <asp:BoundField DataField="DeviceGroupName" HeaderText="Nome do Grupo" 
                SortExpression="DeviceGroupName" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowInsertButton="True" />
        </Fields>
        <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
        <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
        <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MERCATOR_histConnectionString %>" 
        DeleteCommand="DELETE FROM [DeviceGroup] WHERE [GroupID] = @GroupID" 
        InsertCommand="INSERT INTO [DeviceGroup] ([GroupID], [DeviceGroupName]) VALUES (@GroupID, @DeviceGroupName)" 
        SelectCommand="SELECT * FROM [DeviceGroup] ORDER BY [GroupID]" 
        UpdateCommand="UPDATE [DeviceGroup] SET [DeviceGroupName] = @DeviceGroupName WHERE [GroupID] = @GroupID">
        <DeleteParameters>
            <asp:Parameter Name="GroupID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="GroupID" Type="String" />
            <asp:Parameter Name="DeviceGroupName" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="DeviceGroupName" Type="String" />
            <asp:Parameter Name="GroupID" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</p>
</asp:Content>
